package com.alibaba.citrus.ots.sales.plan.model.enums;

import java.util.Arrays;

/**
 * @author zls
 * @description: 提报人角色编码
 * @date 2021-09-27 11:03
 */
public enum SalesPlanReportRoleCodeEnum {

    /**
     * 平台超级管理员
     */
    ADMINISTRATOR("administrator", "平台超级管理员"),
    /**
     * 业务员
     */
    SALESMAN("001", "业务员"),

    /**
     * 渠道经理
     */
    CHANNEL_MANAGER("002", "渠道经理"),

    /**
     * 调度员
     */
    DISPATCHER("003", "调度员"),

    /**
     * 总经理
     */
    GENERAL_MANAGER("004", "总经理");

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    SalesPlanReportRoleCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SalesPlanReportRoleCodeEnum of(String code) {
        return Arrays.stream(SalesPlanReportRoleCodeEnum.values()).filter(source -> code.equals( source.code)).findFirst().orElse(null);
    }
}
